Skip to content

feat(core,ios,android,contract,daemon,cli,client,http,gateway): simlock component remove removes a component Simlock installed - #234

Merged
V3RON merged 1 commit into
mainfrom
task/221
Oct 2, 2026
Merged

V3RON merged 1 commit into
mainfrom
task/221

Conversation

@V3RON

@V3RON V3RON commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Closes #221

simlock component remove <ios|android> <version> [--dry-run] [--yes] removes a runtime or system image Simlock installed. The same admin operation, component.remove, is removeComponent on the admin client and DELETE /v1/components/{platform}/{version} over HTTP. A gateway answers UNSUPPORTED_IN_GATEWAY_MODE. There are three new codes: COMPONENT_NOT_OWNED, COMPONENT_IN_USE and COMPONENT_BUSY. One new event: component.removed.

ComponentInstaller.remove checks the record against the listing, refuses users and a busy platform, and takes the platform's turn. Inside the decision gate it marks the component. Each driver's removeComponent goes through removeListedComponent: it proves the receipt again, counts foreign devices again, removes, and checks the component is gone. On iOS it reports a download left in the asset store as residue.

Not in the spec:

  • DeviceProvisioner claims each new device inside the gate through ComponentInstaller.claimProvision. A device still being created counts as in use, and a marked component refuses it with RUNTIME_MISSING.
  • A second removal on the same platform gets COMPONENT_BUSY.
  • close() aborts a running removal, which answers DAEMON_STOPPING.
  • A removal that fails after the driver was called is logged with who asked.
  • Both platform steps run through runBoundedProcess: SIGTERM, then SIGKILL, then wait for the process to exit.

Done when

  • Real hardware, Android image removed and its directory gone: not run, needs the maintainer's go-ahead.
  • Real hardware, iOS runtime removed and gone from simlock catalog, with the asset-store and residue outcome recorded: not run, needs the maintainer's go-ahead.
  • e2e with the fake driver: e2e/component-remove.test.ts covers remove, dry run, not owned, in use (a leased device and a foreign one) and the agent refusal.
  • pnpm check is green: 2667 unit tests and 82 fast-lane e2e tests.

#213 Completion conditions

  • After an install, the listing shows the component as Simlock's with its size, and one already on the machine as not Simlock's: e2e/component-list.test.ts, and the dry-run case in e2e/component-remove.test.ts.
  • Removing a component Simlock installed that no device uses succeeds, and simlock catalog stops listing it: fake-driver e2e. Not run on real hardware.
  • Removing a component Simlock did not install fails and deletes nothing: e2e (exit 12, no removeComponent call), plus installer and driver unit tests.
  • Removing a component a Simlock device uses fails and deletes nothing: e2e with a leased device, and unit tests for every device state.
  • Removing an iOS runtime that a simulator in the user's own device set uses fails and deletes nothing: an iOS driver unit test with a scripted default set, and the scripted runner refuses any delete. Not run on a real machine.
  • The dry run changes nothing: unit tests (no driver verb that changes anything is called, the record stays) and e2e.
  • An agent session gets FORBIDDEN: e2e and dispatcher test.
  • docs/CLI.md describes the commands and both refusals, and docs/EVENTS.md lists component.removed.

Review

Spec review: 8 findings, 4 fixed; round 2: 5 findings, 1 fixed. Code review: 10 findings, 7 fixed; round 2: 8 findings, 7 fixed.

Rejected:

  • The real-hardware Done-when lines are not delivered. They need the maintainer's go-ahead, so they are left unchecked.
  • pnpm check cannot be seen from the diff. It is green on the head commit; the counts are above.
  • There is no behavioural warm-pool test. The warm pool and startup convergence never provision. A test pins DeviceProvisioner as the only caller of driver.provision and registerDevice, and its claim is tested.
  • COMPONENT_BUSY for a second removal is not in the spec. A removal holds the platform's turn, so a second one cannot take it, and refusing is the safe answer.
  • close() aborting a removal is not in the spec. Architecture rule 12 needs every exit to end in one named state, and a daemon stop ends an install the same way (ADR 0010 §3).
  • devices in the listing now counts devices being provisioned. A removal must see a device before it has a record, and rule 10 makes the listing and the removal use one count.
  • iOS deletes with simctl --set <root> runtime delete. Every scoped simctl call goes through one insertion point, enforced by a test (safety rule 8). Runtime commands ignore the device set, as the existing runtime list call shows.
  • A lease that resolved before a removal and provisions after it ends at its queue timeout, not with RUNTIME_MISSING. No device is created, and a runtime deleted outside Simlock between resolve and provision behaves the same way.
  • A removal that fails after the driver removed the component keeps the record. That record matches nothing, so it proves nothing (ADR 0010 §5), and the next install of that version replaces it. The failure is now logged.
  • The installer and the driver both prove the receipt and count foreign devices (rule 10). ADR 0010 §8 and the spec ask the driver to check again at removal time, and both checks read the same listing.

Written by an agent.

…ck component remove removes a component Simlock installed

`simlock component remove <ios|android> <version> [--dry-run] [--yes]`
removes a runtime or system image Simlock installed. It is the admin
operation `component.remove`, `removeComponent` on the admin client and
`DELETE /v1/components/{platform}/{version}`.

The installer proves the record against the listing, refuses users and
a busy platform, holds the platform's turn, and marks the component in
the decision gate so no device is provisioned on it. Each driver's
`removeComponent` re-proves, re-counts foreign devices, removes and
verifies. iOS reports the asset-store download as `residue`.

Closes #221
@V3RON
V3RON merged commit cf64b43 into main Oct 2, 2026
14 checks passed
V3RON added a commit that referenced this pull request Oct 2, 2026
…ion's component; the dispatcher double has #234's members
@V3RON
V3RON deleted the task/221 branch November 6, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

simlock component remove removes a component Simlock installed

1 participant